/DIV>
WindowPathSelect
Displays a window path pop-up menu.
pascal OSStatus WindowPathSelect (
WindowPtr window,
MenuHandle menu,
SInt32 *outMenuResult);
-
window
-
A value of type
WindowPtr
. Pass a pointer to the window for which a window path pop-up menu is to be displayed.
-
menu
-
A value of type
MenuHandle
. Pass a handle to a menu to be displayed for the specified window or
NULL
. If you pass
NULL
in this parameter, the Window Manager provides a default menu and sends a Reveal Object Apple event to the Finder if a menu item is selected. Note that in order to pass
NULL
, there must be a file currently associated with the window. If you pass in a menu handle, this menu supersedes the default window path pop-up menu, and the
WindowPathSelect
function temporarily inserts the specified menu into the current pop-up menu list. There does not have to be a file currently associated with the window if you pass in your own menu handle.
-
outMenuResult
-
A pointer to a value that, on return, contains the menu and menu item the user chose. The high-order word of the value produced contains the menu ID, and the low-order word contains the item number of the menu item. If the user does not select a menu item, 0 is produced in the high-order word, and the low-order word is undefined. For file menus that have not been overridden, 0 is always produced in this parameter. Pass
NULL
in this parameter if you do not want this information.
-
function result
-
A result code. See
Result Codes.
DISCUSSION
Your application should call the
WindowPathSelect
function when it detects a Command-click in the title of a window, that is, when the function
IsWindowPathSelectClick
returns a value of
true
. Calling
WindowPathSelect
causes the Window Manager to display a window path pop-up menu for your window.
Listing 2-5
in
Displaying a Window Path Pop-Up Menu
shows an example of how your application might call the
WindowPathSelect
function.
SPECIAL CONSIDERATIONS
Note that when
WindowPathSelect
returns
noErr
, your application should ensure that the window opened by the Finder's Reveal Object Apple event handler is visible to the user. To do this, your application should call the Process Manager function
SetFrontProcess
with the Finder's process serial number, as shown in
Listing 2-6
in
Displaying a Window Path Pop-Up Menu
.
VERSION NOTES
Available with Mac OS 8.5 and later.
© 1999 Apple Computer, Inc. – (Last Updated 18 March 99)